package m.jclecai.com.dialog;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

import m.jclecai.com.R;


public class HHDialog extends Dialog implements OnClickListener{

	private Button confirmBtn, cancelBtn;
	private TextView homeTeam, drawTeam;
	public TextView oddHome,oddDraw,oddAway,oddHomeR,oddDrawR,oddAwayR,oddDataClose,oddDataCloseR;
	private LinearLayout oddData,oddDataR;
	public TextView oddss,oddsp,oddsf,oddps,oddpp,oddpf,oddfs,oddfp,oddff;
	public TextView oddZero,oddOne,oddTwo,oddThree,oddFour,oddFive,oddSix,oddSeven;
	public TextView odd10,odd20,odd21,odd30,odd31,odd32,odd40,odd41,odd42,odd50,odd51,odd52,odd99;
	public TextView odd00,odd11,odd22,odd33,odd19;
	public TextView odd01,odd02,odd12,odd03,odd13,odd23,odd04,odd14,odd24,odd05,odd15,odd25,odd09;
	private Context context;
	private HHDialogListener listener;
	private View mView;

	
	public interface HHDialogListener {
		public void onClick(View view);
	}
	
	public HHDialog(Context context) {
		super(context);
		this.context = context;
	}
	
	public HHDialog(Context context,int theme) {
		super(context, theme);
		this.context = context;
	}

	public HHDialog(Context context, int theme, HHDialogListener listener) {
		super(context, theme);
		this.context = context;
		this.listener = listener;
		LayoutInflater inflater = LayoutInflater.from(this.context);
		mView = inflater.inflate(R.layout.dialog_hh_show, null);
	}
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		initView();
	}

	private void initView() {
		// TODO Auto-generated method stub
		setContentView(mView);
		confirmBtn = (Button) mView.findViewById(R.id.dialog_confirm);
		cancelBtn = (Button) mView.findViewById(R.id.dialog_cancel);
		homeTeam = (TextView) mView.findViewById(R.id.dialog_home_team);
		drawTeam = (TextView) mView.findViewById(R.id.dialog_draw_team);
		oddHome = (TextView) mView.findViewById(R.id.dialog_odd_home);
		oddAway = (TextView) mView.findViewById(R.id.dialog_odd_away);
		oddDraw = (TextView) mView.findViewById(R.id.dialog_odd_draw);
		oddHomeR = (TextView) mView.findViewById(R.id.dialog_odd_home_rang);
		oddAwayR = (TextView) mView.findViewById(R.id.dialog_odd_away_rang);
		oddDrawR = (TextView) mView.findViewById(R.id.dialog_odd_draw_rang);
		oddDataClose = (TextView) mView.findViewById(R.id.dialog_odd_data_close);
		oddDataCloseR = (TextView) mView.findViewById(R.id.dialog_odd_rang_data_close);
		oddData = (LinearLayout) mView.findViewById(R.id.dialog_odd_data);
		oddDataR = (LinearLayout) mView.findViewById(R.id.dialog_odd_rang_data);
		oddss = (TextView) mView.findViewById(R.id.dialog_odd_ss);
		oddsp = (TextView) mView.findViewById(R.id.dialog_odd_sp);
		oddsf = (TextView) mView.findViewById(R.id.dialog_odd_sf);
		oddps = (TextView) mView.findViewById(R.id.dialog_odd_ps);
		oddpp = (TextView) mView.findViewById(R.id.dialog_odd_pp);
		oddpf = (TextView) mView.findViewById(R.id.dialog_odd_pf);
		oddfs = (TextView) mView.findViewById(R.id.dialog_odd_fs);
		oddfp = (TextView) mView.findViewById(R.id.dialog_odd_fp);
		oddff = (TextView) mView.findViewById(R.id.dialog_odd_ff);
		oddZero = (TextView) mView.findViewById(R.id.dialog_odd_0);
		oddOne = (TextView) mView.findViewById(R.id.dialog_odd_1);
		oddTwo = (TextView) mView.findViewById(R.id.dialog_odd_2);
		oddThree = (TextView) mView.findViewById(R.id.dialog_odd_3);
		oddFour = (TextView) mView.findViewById(R.id.dialog_odd_4);
		oddFive = (TextView) mView.findViewById(R.id.dialog_odd_5);
		oddSix = (TextView) mView.findViewById(R.id.dialog_odd_6);
		oddSeven = (TextView) mView.findViewById(R.id.dialog_odd_7);
		odd10 = (TextView) mView.findViewById(R.id.dialog_odd_10);
		odd20 = (TextView) mView.findViewById(R.id.dialog_odd_20);
		odd21 = (TextView) mView.findViewById(R.id.dialog_odd_21);
		odd30 = (TextView) mView.findViewById(R.id.dialog_odd_30);
		odd31 = (TextView) mView.findViewById(R.id.dialog_odd_31);
		odd32 = (TextView) mView.findViewById(R.id.dialog_odd_32);
		odd40 = (TextView) mView.findViewById(R.id.dialog_odd_40);
		odd41 = (TextView) mView.findViewById(R.id.dialog_odd_41);
		odd42 = (TextView) mView.findViewById(R.id.dialog_odd_42);
		odd50 = (TextView) mView.findViewById(R.id.dialog_odd_50);
		odd51 = (TextView) mView.findViewById(R.id.dialog_odd_51);
		odd52 = (TextView) mView.findViewById(R.id.dialog_odd_52);
		odd99 = (TextView) mView.findViewById(R.id.dialog_odd_99);
		odd00 = (TextView) mView.findViewById(R.id.dialog_odd_00);
		odd11 = (TextView) mView.findViewById(R.id.dialog_odd_11);
		odd22 = (TextView) mView.findViewById(R.id.dialog_odd_22);
		odd33 = (TextView) mView.findViewById(R.id.dialog_odd_33);
		odd19 = (TextView) mView.findViewById(R.id.dialog_odd_19);
		odd01 = (TextView) mView.findViewById(R.id.dialog_odd_01);
		odd02 = (TextView) mView.findViewById(R.id.dialog_odd_02);
		odd12 = (TextView) mView.findViewById(R.id.dialog_odd_12);
		odd03 = (TextView) mView.findViewById(R.id.dialog_odd_03);
		odd13 = (TextView) mView.findViewById(R.id.dialog_odd_13);
		odd23 = (TextView) mView.findViewById(R.id.dialog_odd_23);
		odd04 = (TextView) mView.findViewById(R.id.dialog_odd_04);
		odd14 = (TextView) mView.findViewById(R.id.dialog_odd_14);
		odd24 = (TextView) mView.findViewById(R.id.dialog_odd_24);
		odd05 = (TextView) mView.findViewById(R.id.dialog_odd_05);
		odd15 = (TextView) mView.findViewById(R.id.dialog_odd_15);
		odd25 = (TextView) mView.findViewById(R.id.dialog_odd_25);
		odd09 = (TextView) mView.findViewById(R.id.dialog_odd_09);
		
		
		oddHome.setOnClickListener(this);
		oddAway.setOnClickListener(this);
		oddDraw.setOnClickListener(this);
		oddHomeR.setOnClickListener(this);
		oddAwayR.setOnClickListener(this);
		oddDrawR.setOnClickListener(this);
		oddss.setOnClickListener(this);
		oddsp.setOnClickListener(this);
		oddsf.setOnClickListener(this);
		oddps.setOnClickListener(this);
		oddpp.setOnClickListener(this);
		oddpf.setOnClickListener(this);
		oddfs.setOnClickListener(this);
		oddfp.setOnClickListener(this);
		oddff.setOnClickListener(this);
		oddZero.setOnClickListener(this);
		oddOne.setOnClickListener(this);
		oddTwo.setOnClickListener(this);
		oddThree.setOnClickListener(this);
		oddFour.setOnClickListener(this);
		oddFive.setOnClickListener(this);
		oddSix.setOnClickListener(this);
		oddSeven.setOnClickListener(this);
		odd01.setOnClickListener(this);
		odd02.setOnClickListener(this);
		odd03.setOnClickListener(this);
		odd04.setOnClickListener(this);
		odd05.setOnClickListener(this);
		odd09.setOnClickListener(this);
		odd10.setOnClickListener(this);
		odd00.setOnClickListener(this);
		odd11.setOnClickListener(this);
		odd12.setOnClickListener(this);
		odd13.setOnClickListener(this);
		odd14.setOnClickListener(this);
		odd15.setOnClickListener(this);
		odd19.setOnClickListener(this);
		odd20.setOnClickListener(this);
		odd21.setOnClickListener(this);
		odd22.setOnClickListener(this);
		odd23.setOnClickListener(this);
		odd24.setOnClickListener(this);
		odd25.setOnClickListener(this);
		odd30.setOnClickListener(this);
		odd31.setOnClickListener(this);
		odd32.setOnClickListener(this);
		odd33.setOnClickListener(this);
		odd40.setOnClickListener(this);
		odd41.setOnClickListener(this);
		odd42.setOnClickListener(this);
		odd50.setOnClickListener(this);
		odd51.setOnClickListener(this);
		odd52.setOnClickListener(this);
		odd99.setOnClickListener(this);
		confirmBtn.setOnClickListener(this);
		cancelBtn.setOnClickListener(this);
	}

	@Override
	public void onClick(View arg0) {
		// TODO Auto-generated method stub
		listener.onClick(arg0);
	}
	
	@Override
	public View findViewById(int id) {
		// TODO Auto-generated method stub
		return super.findViewById(id);
	}

	public View getView() {
		return mView;
	}

}
